package cn.fintecher.pangolin.service.manage.web;

import cn.fintecher.pangolin.common.web.BaseController;
import cn.fintecher.pangolin.entity.mysql.Color;
import cn.fintecher.pangolin.service.manage.service.ColorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.scripting.support.ResourceScriptSource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: xiaqun
 * @Description: 颜色相关接口
 * @Date: 18:00 2019/8/16
 */

@RestController
@RequestMapping("/api/colorController")
@Api(value = "颜色相关接口", description = "颜色相关接口")
public class ColorController extends BaseController {
    @Autowired
    private ColorService colorService;

    /**
     * 获取全部颜色
     */
    @ApiOperation(value = "获取全部颜色", notes = "获取全部颜色")
    @GetMapping("/findAllColor")
    public ResponseEntity<List<Color>> findAllColor() {
        log.info("REST request to find all color");
        List<Color> list = colorService.findAllColor();
        return ResponseEntity.ok().body(list);
    }
}
